﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using SingleUserMall.Items;
using SingleUserMall.Orders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.Refunds.VO
{
    [AutoMapFrom(typeof(OrderDetail))]
    public class OrderDetailMiniVO : EntityDto<long>
    {
        internal Order inOrder { get; set; }
        internal Item inItem { get; set; }
        internal ItemSpec inItemSpec { get; set; }
        /// <summary>
        /// 商品图片
        /// </summary>
        public string Picture => inItemSpec?.Picture;
        /// <summary>
        /// 商品名称
        /// </summary>
        public string Name => inItem?.Name;
        /// <summary>
        /// 规格编号
        /// </summary>
        public string SpecNo => inItemSpec?.SpecNo;
        /// <summary>
        /// 规格
        /// </summary>
        public string Spec => inItemSpec?.Spec;
        /// <summary>
        /// 单价
        /// </summary>
        public decimal Price { get; set; }
        /// <summary>
        /// 单件需要积分
        /// </summary>
        public decimal Points { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int Qty { get; set; }
        /// <summary>
        /// 价格合计
        /// </summary>
        public decimal TotalPrice => Price * Qty;
        /// <summary>
        /// 积分合计
        /// </summary>
        public decimal TotalPoints => Points * Qty;
    }
}
